Repository navigation
docs(frontend): comments and coherence pass (App … FilterRulesView) - #1746
smart-ssh-coordinator[bot] merged 6 commits into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Review
Verdict: changes requested
Review level: elevated (FileBrowserPanel.tsx is a security path; its changes are comment-only)
Blocking
-
apps/smart-ssh-community/frontend/src/App.tsx:152(handleCreateFirstServer): no test covers this rework (AC3). The PR names only "the existing App and api tests". Counter-proof, run locally: withsetPendingNoteEditSelection({ kind: "newServer", groupId: null })removed,src/App*,ServerList*andManagementView*all stay green (86/86).ServerList.test.tsx:201only checks that the callback is called, ande2e/tests/server-management-review.spec.ts:72only checks that the button is visible. Fix: add an App-level test (or an e2e step) that clicks "Add first server" and asserts that the new-server form opens in Manage with no group. Then name that test in the PR. -
apps/smart-ssh-community/frontend/src/components/AddAiProviderDialog.tsx:103-106: the comment this PR edited contradicts the code (AC2). It now covers the edit form but still ends "reopening starts empty". In edit mode the form starts fromformFromProvider(provider), so name, type, base URL and model are pre-filled and only the key is empty. Suggested: "…discards the entries (including the API key); reopening starts from scratch: empty, or the stored provider (without its key) when editing." Also wrap the overlong line 104. -
apps/smart-ssh-community/frontend/src/components/AppHeader.tsx:41-43: the new doc comment is wrong for the narrow layout (AC2). It puts logo and version info on the left and settings on the right, and limits only the main navigation to the wide layout. In the code,narrowalso hides the logo/version block (!narrow && …, ~line 107) and the settings button (~line 178). Suggested: "wide: logo and version info, main navigation,children(session tabs), activity center, settings; narrow: onlychildren(burger + title) and the activity center." -
apps/smart-ssh-community/frontend/src/api/api.ts:872: a doc comment is attached to the wrong function (AC2, applies to every listed file). "Ziel-Nutzer des aktiven erhöhten Kanals,null= aus." sits on top of the doc forsftpElevationAllowed. It describessftpElevationStatus, two lines further down, which has no doc. This PR added the section header right above it. Move the line ontosftpElevationStatus. -
apps/smart-ssh-community/frontend/src/api/errorCodes.ts:229-247: history narration remains, and one reference now points to nothing (requirement "remove what only narrates history", AC2). Details:MASTER_PASSWORD_FILE_ABSENTstill says "Vorher lief das unterMASTER_PASSWORD_FILE_FAILED, und der Text behauptete …".MASTER_PASSWORD_MODE_MISMATCHstill says "als einer gemeldet behauptete die Meldung …".- Both comments now start with a broken short first line.
KEYCHAIN_KEY_MISMATCHstarts "Derselbe Fund:", but the PR removed the review finding that referred to.
Say what the code does and why, e.g. "'Neu anfangen' on a database without a key file here: not a file error, the keychain mode is already active." and "The operation does not fit the active mode (A18); not a file error." The stage wording in the same listed files falls under the same requirement. Fix these while you are there:
errorCodes.ts:206("seit Etappe 2") and:219("(Etappe 3)").buses/navigationBus.ts:1andapi/events.ts:148("(Etappe 4)").errorCodes.ts:82is missing a colon ("Spec 0069, Teil A5: dritter …").
-
apps/smart-ssh-community/frontend/src/App.tsx:212→:284: a valid "why" was deleted instead of moved (requirement "keep and sharpen the why"). The removed Spec 0010 comment explained why<NoteSuggestionToast />is mounted once at the root: a suggestion must still arrive after the user left the session screen, and switching views must not remount it. Its subject is still there at line 284; only the comment was in the wrong place.events.ts:142keeps only the first half of the reason. Fix: put it on that line, e.g.{/* Spec 0010, §2 item 6: mounted once at the root so a suggestion still arrives after the session screen was left, and view switches do not remount the listener. */} -
apps/smart-ssh-community/frontend/src/components/ChatRetentionSettings.tsx:8-13: bolted-on shape documented instead of reworked (in-scope rework, requirement "names that no longer fit / data living in the wrong type").ChatRetentionSettingsis registered as the whole "Sitzungen & Daten" category (extensions/registerBuiltinExtensions.ts:28). Besides chat retention, it rendersAutoReconnectSettingsandElevatedIdleSettings. The PR writes this into the doc comment. Clean shape: aSessionsAndDataSettingscategory component that renders the three sections as equals, withChatRetentionSettingsholding only retention. The only caller to change isregisterBuiltinExtensions.ts, which is a direct caller and allowed by the issue. Cover it with the existingChatRetentionSettings/SettingsScreentests (adjusted), and name them in the PR. No open PR touches these files.
Non-blocking
api/errorCodes.ts:316: "errors.<code>exists in every locale" is true today: I checked all 109 known codes against all 25locales/*/common.jsonfiles and none is missing. But no test enforces this for the whole set, and theMASTER_PASSWORD_ERROR_CODESdoc says so. Consider "every known code must have anerrors.<code>text; tests check this for the lists above".AddAiProviderDialog.tsx:191: movingkeyForRequestonly changes its position, so behaviour is unchanged. Still, the edit-mode branch has no test: with it changed to alwayseffectiveApiKey(f),AiProviderSettings*/SettingsScreen*stay green (106/106). Don't describe it as covered in the PR.BackupDialogs.tsx:28:checkRefis attached to the input but never read. This is in a listed file and trivial to remove now, so it doesn't need a follow-up.- Overlong lines after rewrapping:
AddAiProviderDialog.tsx:102,AutoExecRulesLine.tsx(rule doc),FileBrowserPanel.tsx:74. Style only.
Verified
-
AC1: all 43 files are listed (19 changed, 24 "no change"), and each entry matches the diff (read: PR body,
git diff origin/develop...HEAD). -
AC2: the other new or changed comments match the code. Checked against the code by two reviewers, and spot-checked by me:
event_names.rs,PROMPT_TIMEOUT, the question card,useRemoteDirectory,useLocalEditSession→loadFileTypeApps.SPEECH_MODEL_PARAKEET, the DataPathsSection keychain name, the DiagnosticsSettings contents, ChatRetentionSettings (30-day start value), the AiProviderSettingsdivide-ylist.
The four state comments removed from ChatPanel were orphans. (read)
-
The removed types
ConnectStepStatus,ChatHistoryRoleandKeychainUnavailableReasonhave no users. The generated*Dtotypes remain (executed:rg,npx tsc -b). -
errorCodes.ts:MASTER_PASSWORD_ERROR_CODESis moved with the same contents, andKNOWN_ERROR_CODESis unchanged (read; executed:errorCodes.test.ts). -
counter-proof: not applicable (no bug fix). Two mutation checks ran instead (executed, then reverted): the App handler and the
keyForRequestedit branch both stay green, so neither has test coverage (see above). -
edge cases: removed types used in e2e → none. Reordered consts used at init → no.
translateErrorCodereturn unchanged → ok. -
callers checked:
handleCreateFirstServer(1 call site) → ok;handleCreateServerInGroup(0 left) → ok;keyForRequest(2 call sites) → ok. -
tests run locally:
npx tsc -b→ exit 0 (executed).npm run lint→ exit 0 (executed).npx vitest runon 38 affected files → 834 passed, 6 skipped (executed).
-
UI:
e2e/tests/server-management-review.spec.tspassed (60 tests, executed locally). No visible UI change: only comments changed inside JSX. -
data: not touched.
-
CI: all checks green (
gh pr checks 1746).
Timing analysis
- No test files changed.
Coherence
- comments: 19 files checked. Two contradict the code (blocking above: AddAiProviderDialog, AppHeader). Also blocking above: one misplaced doc in api.ts, the remaining history narration in errorCodes.ts and a deleted "why" in App.tsx. The finding on
errorCodes.ts:316was dismissed as blocking: the statement is true today (verified across all locales), so it is listed as non-blocking. - fit:
ChatRetentionSettings→ blocking (in-scope, clean shape above).- Renaming
AddAiProviderDialog→ follow-up, not in-scope here: the dialog has also been the edit form since #690, but open PR #1707 is changingAddAiProviderDialog.tsxandAiProviderSettings.tsx, and a rename now would collide with it. - Folding
handleCreateServerInGroupand movingkeyForRequestfit.
Spec and boundary
- visible behaviour changed: none.
- spec searched ("erster Server", Dateibrowser, Fehlercode, Titelleiste, Aufbewahrung): 0069 §C1, 0020/0053/0067, 0014. None needs a change.
- verdict: not needed (comments and refactoring). No changelog fragment is needed, and no ADR.
- boundary, CI changes, vendor: ok. The PR removes history and internal wording, adds nothing new to public texts and does not touch
.github/.
Security checks
- Invariants checked: filter bypass or a new entry point, secrets/API key path (
keyForRequest, base-URL lock), AutoExec vs. Confirm, credential handling, fail-open, loosening against the base. - security review (subagent): 6 files, 5 bypass attempts (key sent before the base URL is filled in, edit mode with an empty key, unknown error code, a removed type still in use, a file-browser action skipping confirmation) → all blocked; no findings. "Threat model: no change – comments only in FileBrowserPanel.tsx" holds: that file has 4 lines added and 5 removed, all comment text.
UI review
- not a UI change (only comments inside JSX changed).
Follow-ups
- Rename
AddAiProviderDialogtoAiProviderDialogonce #1707 has landed, since it is also the edit form (#690). Rename its props and result type to match, and update the two call sites inAiProviderSettings.tsx. errorCodes.tskeeps the known-code set by hand (from the PR). Clean shape: generate the code list from Rust, and have a test check that every code has a text in every locale.create_overlay_titlebardoc comment incrates/app-shell/src/commands/app_meta.rs(from the PR) → covered by the Rust pass, #1694.
…er first-server flow (#1680) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Review points, all addressed in d769b09:
|
There was a problem hiding this comment.
Review
Verdict: changes requested
Review level: elevated (FileBrowserPanel.tsx is a security path. It is not touched in this delta, and its earlier changes are comment-only.)
Follow-up round: delta 7682a384..d769b092. Five of the seven earlier findings are fixed in the code. The other two are fixed in the code but not named in the PR (see Blocking 1). The new split adds four blocking points.
Blocking
-
PR description not updated (AC1, AC3; earlier findings 1 and 7 asked for the tests to be named in the PR). The body is still from the first round.
- App.tsx still says the rework is covered by "the existing App and api tests". Name
src/App.firstServer.test.tsxinstead. - The new rework is missing:
SessionsAndDataSettings.tsxis new, andChatRetentionSettingsnow holds only retention. Its covering test (SettingsScreen.test.tsx› "'Sitzungen & Daten' (registered SessionsAndDataSettings) …") is not named either. - The files touched outside the issue list are not named:
extensions/registerBuiltinExtensions.ts,LanguageSettings.tsx,McpServerSettings.tsx. - The per-file counts are stale (App.tsx, ChatRetentionSettings, errorCodes.ts, AddAiProviderDialog, AppHeader, api.ts, events.ts, navigationBus.ts).
Update the file list, the rework list and the test names.
- App.tsx still says the rework is covered by "the existing App and api tests". Name
-
apps/smart-ssh-community/frontend/src/extensions/registerBuiltinExtensions.ts:29— the change to this caller has no test (AC3).- Counter-proof (executed): with
component: ChatRetentionSettingsput back, the real app would drop "Automatisch neu verbinden" and "Erhöhte Rechte nach Inaktivität ausschalten" from the category. Still, all ofsrc/componentsplusApp.settingsNav.test.tsxstay green (1408 tests). - Why:
SettingsScreen.test.tsx:185-199resets the registry and registersSessionsAndDataSettingsby hand. The comment at:240-242claims the test goes through the built-in registration, which it does not. - Fix: add one test against the real built-in registration, e.g. import
registerBuiltinExtensionsand assert that thechat-retentionentry's component isSessionsAndDataSettings, or render it and expect the three groups. Correct the comment at:240.
- Counter-proof (executed): with
-
apps/smart-ssh-community/frontend/src/components/SessionsAndDataSettings.tsx:12-14withChatRetentionSettings.tsx:55— the split changes visible behaviour (requirement "No change in behaviour").- Before:
ChatRetentionSettingsreturnednulluntilgetChatSessionRetentionDaysresolved, and that also hid the other two sections. - While loading now: auto-reconnect and elevated-idle render at once with their default values. The retention section then appears above them and pushes them down. Until then, auto-reconnect's
mt-6 border-tis the top of the content, and a select the user has already focused moves. - If the load fails: the category now shows two sections, and retention is missing without any notice. Before, the whole category was empty.
- Confirmed by the UI review and the functional review (read:
ChatRetentionSettings.tsx:18-24,55,AutoReconnectSettings.tsx:24,46). - Fix: keep the old gating. For example,
SessionsAndDataSettingsowns the retention load (value,loaded, error) and renders nothing until it has loaded, passing the value down toChatRetentionSettings. Add a test that the auto-reconnect group is not shown while the retention value is still pending.
- Before:
-
Comments this PR edited now contradict the code (AC2).
components/McpServerSettings.tsx:139-141: the comment now points to "SessionsAndDataSettings.tsxs identischer Fund/Begründung (auch für den …border-t/pt-4-Rahmen)".SessionsAndDataSettings.tsxexplains only the missing heading and says nothing about a frame. The frame reasoning was in theChatRetentionSettingscomment that the first commit removed. Say it in place, e.g.// Spec 0055, Teil 3: SettingsScreen renders the category title, so no own heading and no top border/padding frame here.components/LanguageSettings.tsx:28-30: the comment points to the same place. It says "dieselbe doppelte Überschrift", although those files avoid a double heading. It also sits abovehandleThemeChangeinstead of abovereturn (. Move it there and word it like the line above.extensions/registerBuiltinExtensions.ts:1-5: the edited header saysAiProviderSettingshad the category<SessionsAndDataSettings />"bisher fest verdrahtet". That component is new in this PR and was never hard-wired anywhere. Suggested:/** Registers the built-in settings categories "Sitzungen & Daten" (SessionsAndDataSettings) and MCP server (McpServerSettings) through the registry (Spec 0038, Abschnitt 4; Spec 0037/0028). Must run before the first render of AiProviderSettings, which imports this module for its side effect. */
Non-blocking
api/errorCodes.ts:237-238(MASTER_PASSWORD_MODE_MISMATCH): the sibling entries now use "würde". To match them, write "als solcher gemeldet, würde die Meldung einen Zustand behaupten, der nicht vorliegt".App.tsx:284-288: the closing clause "(das löste bei jedem Wechsel … einen Remount aus)" is past tense. Better: "…nicht an einen der Zweige unten gebunden, die bei jedem Wechsel Session-/Tab-Ansicht neu gemountet werden."extensions/registerBuiltinExtensions.ts:17-24still narrates history ("0050-Review-Fund", "war hier ursprünglich …"). You are in this file anyway, so you could reduce it to the "why":labelis a translation key thatresolveSectionLabelresolves, and the registry stays i18n-free.AddAiProviderDialog.tsx:104is still over-long (style).AddAiProviderDialog.tsx:191: thekeyForRequestedit branch still has no test of its own. Don't describe it as covered (still the case from the last round).- Timing,
SettingsScreen.test.tsx:239-254(possible):AutoReconnectSettingsloads through the real, unmocked settings store. Its.then/.catchcan callsetStateafter the test has ended. Mock../settings/autoReconnectSettingsand wait for the final value of the auto-reconnect select (ADR 0122 R6/R7).
Verified
-
AC1: not met, because the PR body is stale (Blocking 1) (read:
gh pr view 1746). -
AC2: the earlier comment findings are fixed (read):
- the
api.tsdoc now sits onsftpElevationStatus; - the AddAiProviderDialog and AppHeader docs match the code;
errorCodes.tshas no stage wording left, the colon is added and the dangling "Derselbe Fund" is gone;events.ts:148andnavigationBus.ts:1are fixed;- the Spec 0010 "why" is on
<NoteSuggestionToast />.
New contradictions: Blocking 4.
- the
-
counter-proof:
App.firstServer.test.tsxis red with thesetPendingNoteEditSelection({ kind: "newServer", groupId: null })call removed, red withgroupId: "g1", and green with the fix (executed).SettingsScreen.test.tsx -t "Sitzungen"is red with<AutoReconnectSettings />removed fromSessionsAndDataSettings, and green with it (executed).- With the built-in registration put back to
ChatRetentionSettings, everything stays green (executed) → Blocking 2.
-
edge cases:
- retention load pending → finding (Blocking 3)
- retention load fails → finding (Blocking 3; the swallowed error banner is pre-existing, see Follow-ups)
- error banner position and spacing in the loaded state → ok
- first server with only the local server present → ok
-
callers checked:
ChatRetentionSettings(1 call site) → okSessionsAndDataSettings(registerBuiltinExtensions) → untested (Blocking 2)handleCreateFirstServer(1) → ok
-
tests run locally:
npx tsc -b→ exit 0 (executed)npm run lint, including check-codemap, check-doc-paths and check-file-size → exit 0 (executed)npx vitest runon 14 affected files → 342 passed (executed)
-
UI:
e2e/tests/switch-forced-colors.spec.tsande2e/tests/settings-notes-review.spec.ts(both open "Sitzungen & Daten") → 44 passed (executed locally). -
data: not touched.
-
CI: all checks green (
gh pr checks 1746), and the branch is up to date withdevelop.
Timing analysis
- 2 test files analysed:
App.firstServer.test.tsx: no timing dependency found.SettingsScreen.test.tsx:239-254: latesetStatefrom the unmocked auto-reconnect store, possible → non-blocking.
Coherence
- comments: 12 files checked. The earlier findings are fixed.
McpServerSettings.tsx:139,LanguageSettings.tsx:28andregisterBuiltinExtensions.ts:1are blocking (Blocking 4).errorCodes.ts:237,App.tsx:288andregisterBuiltinExtensions.ts:17are non-blocking style. - fit:
SessionsAndDataSettingscomposes the category cleanly, andChatRetentionSettingsdoes one thing again. The registry idchat-retentionand the label keysettings.categories.chatRetentionnow name a whole category of three sections → follow-up (it touches every locale file).
Spec and boundary
- visible behaviour changed: intended none. The unintended loading/error difference is Blocking 3.
- spec: not needed (comments and refactoring). No changelog fragment and no ADR needed.
- boundary, CI changes, vendor: ok. No
.github/changes and nothing new in public texts.
Security checks
- The delta touches no security path. It is frontend only, with no new IPC and no change to what needs confirmation.
- security review (subagent): not re-run for this delta, because
FileBrowserPanel.tsxis unchanged since the last round. The earlier result stands: 5 bypass attempts, all blocked, no findings.
UI review
- No screenshots: no capture spec opens "Sitzungen & Daten". The review is from code.
- Loading-state regression → blocking (confirmed, Blocking 3).
- Load error now hides retention silently → blocking as part of Blocking 3. The swallowed error banner itself is pre-existing → follow-up.
- Loaded state: order, gaps, legends and Tab order are unchanged → ok.
Previous findings
- App.tsx
handleCreateFirstServerwithout a test → fixed in d769b09 (App.firstServer.test.tsx, counter-proof red/green). Not named in the PR: still open (Blocking 1). - AddAiProviderDialog doc → fixed in d769b09.
- AppHeader doc → fixed in d769b09.
- api.ts misplaced doc → fixed in d769b09.
- errorCodes history and stage wording, navigationBus, events, colon → fixed in d769b09 (MODE_MISMATCH tense is non-blocking).
- App.tsx Spec 0010 "why" → fixed in d769b09 (tense is non-blocking).
- ChatRetentionSettings → SessionsAndDataSettings → reworked in d769b09. The caller has no test, behaviour changed while loading, and the PR does not name it: Blocking 1-3.
Follow-ups
- Rename the settings category id
chat-retentionand the keysettings.categories.chatRetentiontosessions-and-data/settings.categories.sessionsAndData. Update all locales,SettingsScreen.test.tsx,SettingsScreen.slot.test.tsxand the comment atSettingsScreen.tsx:123. ChatRetentionSettings.tsx:18-24: if loading the retention value fails,loadedstays false and the error banner never shows. The section disappears without notice (pre-existing). Clean shape: render therole="alert"banner when the load fails, notnull.- Rename
AddAiProviderDialogtoAiProviderDialogonce #1707 has landed (from the last round). errorCodes.ts: generate the known-code list from Rust, with a test per locale (from the last round).create_overlay_titlebardoc incrates/app-shell/src/commands/app_meta.rs→ Rust pass, #1694.
…lt-in registration (#1680) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Review round 2 points: (1) PR body updated with new tests, SessionsAndDataSettings rework and files outside the list; (2) added registerBuiltinExtensions.test.ts against the real registration, fixed the SettingsScreen.test comment; (3) SessionsAndDataSettings owns the retention load and renders nothing until loaded (SessionsAndDataSettings.test.tsx); (4) comments in McpServerSettings, LanguageSettings, registerBuiltinExtensions corrected. All fixed in cb42c5e. |
There was a problem hiding this comment.
Review
Verdict: changes requested
Review level: elevated (FileBrowserPanel.tsx is a security path. This delta does not touch it, and its earlier changes are comment-only.)
Follow-up round: delta d769b092..cb42c5e4. All four blocking findings from round 2 are fixed. The fix for finding 3 adds a new data path, and no test covers it. That is the one blocking point left.
Blocking
apps/smart-ssh-community/frontend/src/components/ChatRetentionSettings.tsx:14/SessionsAndDataSettings.tsx:36— no test checks that the loaded retention value reaches the section (requirement "Every rework is covered by existing tests or a new one", AC3).- What changed:
SessionsAndDataSettingsnow loads the value and passes it down asinitialDays. - Why no test catches a break: every test resolves the load with
null. That coversSessionsAndDataSettings.test.tsx, theSettingsScreen.test.tsx:35mock and the e2efakeBackend.ts:343. - Counter-proof (executed by the functional review):
useState<number | null>(initialDays)changed touseState<number | null>(null)→ all 1407 component tests stay green. - Scenario: a user has a 30-day retention stored. After such a regression, the settings show "never delete" and no day field, and no test notices.
- Fix: add a case to
SessionsAndDataSettings.test.tsxthat resolves a non-null value (e.g.14). Assert that the retention switch is on and the number field shows14. Name the test in the PR body.
- What changed:
Non-blocking
SessionsAndDataSettings.tsx:28: the catch comment "Wie bisher: …" points back to the old code, which the issue asks to avoid. Suggested:// Load error: the category stays empty (see the doc comment above).SessionsAndDataSettings.test.tsx:42-45("stays empty when the retention value fails to load"), possibly weak:- The
waitFor(... toHaveBeenCalled())is already true right after render, and the container is empty while the promise is still pending. - The functional review's counter-proof made this test red with the gating removed. Still, flushing the rejection before the assertion would make it airtight, e.g.
await act(async () => { await Promise.resolve(); }).
- The
- Timing (possible, as last round):
SessionsAndDataSettings.test.tsxrendersAutoReconnectSettingsagainst the unmocked settings store. Its latesetSeconds/setErrorcan land after the test ends.- Fix: mock
../settings/autoReconnectSettings, or wait for the final value of the auto-reconnect select (ADR 0122 R6/R7).
- Fix: mock
extensions/registerBuiltinExtensions.ts:16-23still narrates history ("war hier ursprünglich …"). This is open from the last round and is style only.
Verified
- AC1 (every file listed): met. The PR body now names the following (read:
gh pr view 1746):App.firstServer.test.tsx;- the
SessionsAndDataSettingsrework; - the new tests;
- the files outside the list.
- AC2 (no contradicting comment): met in the delta. Checked (read):
LanguageSettings.tsx:33-34,McpServerSettings.tsx:139-141,registerBuiltinExtensions.ts:1-10,SessionsAndDataSettings.tsx:7-16andSettingsScreen.test.tsx:240-241. - AC3 (reworks keep behaviour, tests named): partly met.
- The gating matches
origin/develop: the category is empty while loading and after a load error. - Save, error and busy logic is unchanged (read: base and head compared).
- The value hand-off is untested → Blocking 1.
- The gating matches
- counter-proof (all executed):
registerBuiltinExtensions.test.ts: red with the registration set back toChatRetentionSettings, green with the fix.- Both
SessionsAndDataSettings.test.tsxtests: red withif (!loaded) return nullremoved, and red against the round-2 versions of the two components. Green on HEAD. initialDaysignored → everything green → Blocking 1.
- edge cases:
- load pending → empty (tested), ok
- load error → empty, as on the base (tested), ok
- stored non-null value → untested (Blocking 1)
- callers checked:
ChatRetentionSettings(1 call site) → okSessionsAndDataSettings(registration plus tests) → okchat-retentionid, label and icon → unchanged
- tests run locally (all executed):
npx vitest runon 6 affected files → 47 passednpx vitest run src/components→ 1407 passednpx tsc -b→ cleannpm run lint→ exit 0
- UI: no e2e spec opens this category's retention value with a stored setting. The gating is covered by unit tests, and no Playwright spec was run for this delta.
- data: not touched.
- CI: all checks green on
cb42c5e4, and the branch is up to date withdevelop.
Timing analysis
- 3 test files analysed:
registerBuiltinExtensions.test.ts→ no timing dependency found.SessionsAndDataSettings.test.tsx→ latesetStatefrom the unmocked store, and the error-case assertion may run before the rejection. Both possible → non-blocking.SettingsScreen.test.tsx:240→ comment only.
Coherence
- comments: 6 checked.
- The round-2 findings in
McpServerSettings.tsx,LanguageSettings.tsxandregisterBuiltinExtensions.ts:1-5are fixed. SessionsAndDataSettings.tsx:28("Wie bisher") andregisterBuiltinExtensions.ts:16-23are non-blocking style.
- The round-2 findings in
- fit: moving the retention load into
SessionsAndDataSettingsfits. The category owns the gating, andChatRetentionSettingsno longer keeps a parallelloadedstate. Thechat-retentionid and key naming stays a follow-up.
Spec and boundary
- visible behaviour changed: none (the loading and error gating is restored).
- spec: not needed (comments and refactoring). No changelog fragment and no ADR needed.
- boundary, CI changes, vendor: ok. No
.github/changes.
Security checks
- The delta touches no security path. It is frontend settings only, with no new IPC and no change to what needs confirmation.
- security review (subagent): not re-run, because
FileBrowserPanel.tsxis unchanged since round 1. The earlier result stands: no findings.
UI review
- Not re-run for this delta. The delta restores the pre-PR gating, and the loaded state is unchanged from round 2, where it was reviewed as ok.
Previous findings
- PR description stale → fixed in cb42c5e (PR body updated).
registerBuiltinExtensions.tsregistration without a test → fixed in cb42c5e (registerBuiltinExtensions.test.ts, counter-proof red/green). TheSettingsScreen.test.tsx:240comment is corrected.- Split changed loading/error behaviour → fixed in cb42c5e (
SessionsAndDataSettingsgates on the load, with tests). The new value hand-off is untested → Blocking 1. - Contradicting comments (
McpServerSettings,LanguageSettings,registerBuiltinExtensionsheader) → fixed in cb42c5e.
Follow-ups
- Rename the settings category id
chat-retentionand the keysettings.categories.chatRetentiontosessions-and-data/settings.categories.sessionsAndData. Update all locales, the tests and the comment atSettingsScreen.tsx:123. (No issue yet.) ChatRetentionSettings: if loading the value fails, the category disappears without notice (pre-existing). Clean shape: render arole="alert"banner instead of nothing. (No issue yet.)ChatRetentionSettings: save, toggle, error and busy paths have no tests, on the base or now. (No issue yet.)- Rename
AddAiProviderDialogtoAiProviderDialogafter #1707 lands. errorCodes.ts: generate the known-code list from Rust.create_overlay_titlebardoc incrates/app-shell/src/commands/app_meta.rs→ Rust pass, #1694.
|
Review round 3: blocking point fixed in 772a83e — new test |
There was a problem hiding this comment.
Review
Verdict: approved
Review level: elevated (FileBrowserPanel.tsx is a security path. This delta does not touch it, and its earlier changes in this PR are comment-only.)
Follow-up round 4: delta cb42c5e4..772a83e6. The delta adds one test and one store mock in SessionsAndDataSettings.test.tsx, and rewords one comment in SessionsAndDataSettings.tsx. The round-3 blocking finding is fixed.
Blocking
None.
Non-blocking
- The PR body's "Tests" bullet describes
SessionsAndDataSettings.test.tsxas "(hidden until loaded, hidden on load error)". It does not mention the new casepasses a stored retention value to the retention section. AC3 is still met because the body names the covering test file. Please add the case name anyway if the body is edited again. SessionsAndDataSettings.test.tsx:56:getAllByRole("checkbox")[0]adds little. The field only renders when the switch is on. The assertion is still correct, because the retention switch is the only checkbox in the category.
Verified
- Round-3 finding (stored value reaches the section through
initialDays): fixed. See the new testpasses a stored retention value to the retention section(read:SessionsAndDataSettings.test.tsx:54-60). - Counter-proof (executed by the functional review): the new test goes red for each of the three regressions below, then green again after restoring the code.
- (a)
useState(initialDays)changed touseState(null)inChatRetentionSettings.tsx. - (b)
initialDays={null}inSessionsAndDataSettings.tsx. - (c) The day field ignores
days.
- (a)
- Assertion target:
AutoReconnectSettingsandElevatedIdleSettingsrender only a<select>. So the spinbutton and the checkbox the test queries are the retention controls (read: grep fortype="checkbox",type="number"and<selectin the three sections). - Load-error test: I counter-proved it myself (executed). I put
setLoaded(true)into thecatchbranch and rannpx vitest run src/components/SessionsAndDataSettings.test.tsx: 1 failed, 2 passed. The code was then restored. So the test does catch a load error being treated as loaded. - Edge cases:
- stored value
null→ ok (tested) - stored value
14→ ok (tested) - load rejected → ok (tested)
- stored value
- Callers checked:
ChatRetentionSettings/initialDaysare unchanged in this delta → ok. - Tests run locally (executed):
npx vitest runonSessionsAndDataSettings.test.tsxandSettingsScreen.test.tsx→ 20 passed.- The new file was run 5 more times → 3/3 passed each time.
npx tsc -b→ clean.npm run lint→ exit 0.
- UI: no UI change in this delta (test and comment only).
- Data: not touched.
- CI: all checks green on
772a83e6. The branch is up to date withdevelopand mergeable.
Timing analysis
- 1 test file analysed (
SessionsAndDataSettings.test.tsx):- New test → no timing dependency found.
findByRolewaits for the render after the load. - Late
setStatefrom the auto-reconnect store → fixed, because the store is now mocked. - "Load-error assertion runs before the rejection settles" (reported as likely) → dismissed. The mutation run above shows the assertion does see the settled rejection: the test is red when the
catchbranch setsloaded.
- New test → no timing dependency found.
Coherence
- Comments: 2 checked. The new catch comment ("Without a loaded retention value the category stays hidden.") matches the code:
loadedstaysfalse, so the component returnsnull. The component's doc comment still matches as well. - Fit: the change fits (comment wording only).
Spec and boundary
- Visible behaviour changed: none.
- Spec: not needed (tests and a comment). No changelog fragment and no ADR needed.
- Boundary, CI changes, vendor: ok. No
.github/changes.
Security checks
- The delta touches no security path and no IPC, confirmation, filter, redaction or credential code.
- Security review (subagent): not re-run, because
FileBrowserPanel.tsxis unchanged since round 1. The earlier result stands: no findings.
UI review
- Not a UI change in this delta.
Previous findings
- Stored retention value has no test → fixed in 772a83e (red/green counter-proof executed).
- Non-blocking "Wie bisher" catch comment → fixed in 772a83e.
- Non-blocking: mock the auto-reconnect store → fixed in 772a83e.
- Non-blocking: flush the rejection in the load-error test → not changed. It is not needed: the mutation run shows the test already catches the bug.
Follow-ups
Carried over from the earlier rounds. None of them has an issue yet; the follow-up-pending label is already set.
- Rename the settings category id
chat-retentionand the keysettings.categories.chatRetentiontosessions-and-data/settings.categories.sessionsAndData. Update all locales, the tests and the comment atSettingsScreen.tsx:123. - Retention section: if loading the value fails, the whole category disappears without notice (pre-existing behaviour). Clean shape: render a
role="alert"banner instead of nothing. ChatRetentionSettings: the save, toggle, error and busy paths have no tests, on the base or now.extensions/registerBuiltinExtensions.ts:16-23still narrates history ("war hier ursprünglich …").- Rename
AddAiProviderDialogtoAiProviderDialogafter #1707 lands. errorCodes.ts: generate the known-code list from Rust.create_overlay_titlebardoc incrates/app-shell/src/commands/app_meta.rs→ Rust pass, #1694.
Closes #1680
Summary
Comment and coherence pass over the 43 listed frontend files. Comment-only edits, plus removal of dead code and one small rework.
Files
handleCreateServerInGroup(groupId)(only ever called withnull) is nowhandleCreateFirstServerConnectStepStatus,ChatHistoryRole,KeychainUnavailableReason)keyForRequestmoved so the doc comment sits onrunModelDiscovery; AiProviderSettings: 6; AppHeader: 5; AutoExecRulesLine: 1; ChatPanel: 2, reworked: orphaned comment block removedinitialDays(see below); DataPathsSection: 1; DiagnosticsSettings: 1; FileTypeSettings: 1; FileBrowserPanel: 2 (comments only)Files outside the list and tests added
SessionsAndDataSettings.tsx(reworked): the category now composesChatRetentionSettings,AutoReconnectSettingsandElevatedIdleSettingsas three peer sections. It owns the retention load and renders nothing until it has loaded (also on a load error), as the category did before.extensions/registerBuiltinExtensions.ts: registersSessionsAndDataSettings; header comment corrected.LanguageSettings.tsx,McpServerSettings.tsx: comment fixes only.App.firstServer.test.tsx(first-server flow, red without theApp.tsxfix),SettingsScreen.test.tsx(three sections, one category title), newSessionsAndDataSettings.test.tsx(hidden until loaded, hidden on load error), newextensions/registerBuiltinExtensions.test.ts(real built-in registration usesSessionsAndDataSettings/McpServerSettings).Acceptance Criteria
tsc -band the full vitest suite (2532 tests) pass, including the existing App and api testsSpec: none (comments/refactoring only)
Threat model: no change – comments only in FileBrowserPanel.tsx
Assumptions
Removed types had no usages (
rg, andtsc -bis clean).Follow-ups
errorCodes.tskeeps the known-code set by hand next to the generated IPC types; clean shape: a Rust-generated code list, with the existing test checking DE/EN text per code.ChatPanel.tsx: the jump button is wrapped in a redundant{( … )};checkRefinRecoveryCodeDialog(BackupDialogs.tsx) looks unused.create_overlay_titlebardoc comment incrates/app-shell/src/commands/app_meta.rsnarrates history; belongs to the Rust pass.🤖 Generated with Claude Code